﻿using System;
using System.Globalization;
using System.Windows.Data;
using Repository;

namespace Dispatcher.Converters
{
    class TimeRangeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var ev = value as Event;
            if (ev != null)
                return string.Format("[{0}-{1}]",
                                     ev.StartTime.ToShortTimeString(),
                                     ev.EndTime.ToShortTimeString());
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
